//package com.campus;
//
//import com.campus.app.service.IUserService;
//import com.campus.commons.pojo.Menu;
//import com.campus.commons.pojo.User_;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.security.core.userdetails.UserDetails;
//import org.springframework.security.core.userdetails.UsernameNotFoundException;
//import org.springframework.stereotype.Service;
//
//import java.util.List;
//
//@Service
//public class UserService implements IUserService {
//    @Autowired
//    private UserMapper userMapper; // IUserService
//
//    @Autowired
//    private MenuMapper menuMapper;
//    @Override
//    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
//
//        User_ vo = userMapper.selectUserByUsername(username); //查询获取账号信息
//        if (vo != null) { //账号存在
//            List<Menu> authorities = menuMapper.selectUserAuthorities(vo.getId());//获取账号的权限信息
//            vo.setAuthorities(authorities);
//        }
//        return vo;
//    }
//}

